using System;
using System.Collections.Generic;
using System.Text;
using System.Web.UI.WebControls;
using System.ComponentModel;

namespace GridControl
{   
    /// <summary>
    /// Class that defines each grid column
    /// </summary>
    [TypeConverter(typeof(ExpandableObjectConverter))]  
    public class ColModel:WebControl
    {

        /// <summary>
        /// Initializes a new instance of the <see cref="T:ColModel"/> class.
        /// </summary>
        public ColModel()
        {
            _hidden = false;
        }
        private string _Header;

        /// <summary>
        /// Gets or sets the header.
        /// </summary>
        /// <value>The header.</value>
        [DefaultValue(""), NotifyParentProperty(true),
       RefreshProperties(RefreshProperties.Repaint)] 
        public string header
        {
            get { return _Header; }
            set { _Header = value; }
        }
        private int _Width;

        /// <summary>
        /// Gets or sets the width.
        /// </summary>
        /// <value>The width.</value>
        [DefaultValue(""), NotifyParentProperty(true),
       RefreshProperties(RefreshProperties.Repaint)] 
        public int width
        {
            get { return _Width; }
            set { _Width = value; }
        }
        private bool _Sort;

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="T:ColModel"/> is sort.
        /// </summary>
        /// <value><c>true</c> if sort; otherwise, <c>false</c>.</value>
        [DefaultValue(false), NotifyParentProperty(true),
       RefreshProperties(RefreshProperties.Repaint)] 
        public bool sortable
        {
            get { return _Sort; }
            set { _Sort = value; }
        }
        private bool _hidden;

        /// <summary>
        /// Gets or sets a value indicating whether this <see cref="T:ColModel"/> is hidden.
        /// </summary>
        /// <value><c>true</c> if hidden; otherwise, <c>false</c>.</value>
        [DefaultValue(""), NotifyParentProperty(true),
       RefreshProperties(RefreshProperties.Repaint)] 
        public bool hidden
        {
            get { return _hidden; }
            set { _hidden = value; }
        }
        /// <summary>
        /// New property bind a column to a field
        /// </summary>
        private string _dataIndex;

        /// <summary>
        /// Gets or sets the index of the data.
        /// </summary>
        /// <value>The index of the data.</value>
        [DefaultValue(""), NotifyParentProperty(true),
        RefreshProperties(RefreshProperties.Repaint)] 
        public string dataIndex
        {
            get { return _dataIndex; }
            set { _dataIndex = value; }
        }
        /// <summary>
        /// Data type to be applied to sort
        /// </summary>
        private string _type;
        /// <summary>
        /// Gets or sets the type.
        /// </summary>
        /// <value>The type.</value>
        [DefaultValue(""), NotifyParentProperty(true),
       RefreshProperties(RefreshProperties.Repaint)] 
        public string type
        {
            get { return _type; }
            set { _type = value; }
        }

    }
}
